//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.andromeda.androbench2;

import android.content.Context;
import android.util.Log;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpParams;

public class CustomHttpClient extends DefaultHttpClient {
    private static String TAG = "MyHttpClient";
    private static Context appContext = null;
    private static Scheme httpScheme = null;
    private static Scheme httpsScheme = null;
    private static HttpParams params = null;
    private static SchemeRegistry schmReg = null;

    public CustomHttpClient(Context var1) {
        appContext = var1;
        if (httpScheme == null || httpsScheme == null) {
            httpScheme = new Scheme("http", PlainSocketFactory.getSocketFactory(), 80);
            httpsScheme = new Scheme("https", this.mySSLSocketFactory(), 443);
        }

        this.getConnectionManager().getSchemeRegistry().register(httpScheme);
        this.getConnectionManager().getSchemeRegistry().register(httpsScheme);
    }

    private SSLSocketFactory mySSLSocketFactory() {
        try {
            KeyStore var14 = KeyStore.getInstance("BKS");
            InputStream var15 = appContext.getResources().openRawResource(R.raw.androbench);
            var14.load(var15, "androbench".toCharArray());
            var15.close();
            SSLSocketFactory var16 = new SSLSocketFactory(var14);
            return var16;
        } catch (UnrecoverableKeyException var24) {
            Log.d(TAG, var24.getMessage());
            return null;
        } catch (KeyStoreException var25) {
            Log.d(TAG, var25.getMessage());
            return null;
        } catch (KeyManagementException var26) {
            Log.d(TAG, var26.getMessage());
            return null;
        } catch (NoSuchAlgorithmException var27) {
            Log.d(TAG, var27.getMessage());
            return null;
        } catch (IOException var28) {
            Log.d(TAG, var28.getMessage());
            return null;
        } catch (Exception var29) {
            Log.d(TAG, var29.getMessage());
            return null;
        } finally {
            ;
        }
    }
}
